/*
 * StreamOperationCore.h
 *
 *  Created on: 2011-3-31
 *      Author: hao
 */

#ifndef STREAMOPERATIONCORE_H_
#define STREAMOPERATIONCORE_H_

#include <string>

class StreamOperationPlugin{
public:
	virtual bool init() = 0;
	virtual bool StreamRunning( void * pData, size_t length , unsigned bit_pre_sample, unsigned channels, unsigned rate ) = 0;
        virtual ~StreamOperationPlugin(){}
};

class StreamOperationCore : public StreamOperationPlugin{

	void * StreamOperationCoreHandle;

	std::string patch;

	bool ( *StreamOperation )( void * pData, size_t length , unsigned bit_pre_sample, unsigned channels, unsigned rate );
        bool ( *CoreInit )();
        void ( *CoreDestroy )();

public:
	StreamOperationCore( const char * szPath );

	bool init();

	bool StreamRunning( void * pData, size_t length , unsigned bit_pre_sample, unsigned channels, unsigned rate );

	~StreamOperationCore();
};

#endif /* STREAMOPERATIONCORE_H_ */
